package com.vcredit.creditcat.service;

import com.vcredit.creditcat.model.LoginPreview;
import com.vcredit.creditcat.persistence.LoginPreviewMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by liaoshengjun on 2017/10/27.
 */
@Service
public class LoginPreviewService {
	@Autowired
	private LoginPreviewMapper mapper;

	public void insert(LoginPreview obj) {
		mapper.insert(obj);
	}

	public void update(LoginPreview obj) {
		mapper.update(obj);
	}

	public List<LoginPreview> findAll() {
		return mapper.findAll();
	}

	public LoginPreview findById(Long loginPreviewId){
		return mapper.findById(loginPreviewId);
	}

	public List<LoginPreview> findByMobile(String mobile){
		return mapper.findByMobile(mobile);
	}

	/**
	 * 查询用户未预检的产品
	 * @param mobile
	 * @return
	 */
	public List<Long> findUnPreviewProductByMobile(String mobile){
		return mapper.findUnPreviewProductByMobile(mobile);
	}
}
